package com.create404.suishoupai.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.create404.suishoupai.entity.Announcement;
import com.create404.suishoupai.vo.AnnouncementListItemVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author create404
 * @since 2021-07-17
 */
public interface AnnouncementMapper extends BaseMapper<Announcement> {

    /**
     * 获取公告列表
     *
     * @return
     */
    @Select("SELECT announcement.*, employee.`name` FROM announcement INNER JOIN employee ON announcement.publisher_id = employee.employee_id")
    List<AnnouncementListItemVO> getAnnouncementList();
}
